<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="description" content="第三届金陀螺奖" />
    <meta name="keywords" content="活动，陀螺活动，金陀螺活动，" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>第三届金陀螺奖</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="css/style.css" />
</head>

<body>
    <div class="navbar-inverse nav-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
			            <span class="sr-only">Toggle navigation</span>
			            <span class="icon-bar"></span>
			            <span class="icon-bar"></span>
			            <span class="icon-bar"></span>
			          </button>
                <a href="index.html"><img class="logo-img img-responsive" src="img/vote_logo.png" /></a>
            </div>
            <div class="nav-center collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav menu_ul">
                    <li>
                        <a href="index.html" target="_blank">首页</a>
                    </li>
                    <li>
                        <a class="active" href="goldtl.html" target="_blank">金陀螺奖</a>
                    </li>
                    <li>
                        <a href="plate.html" target="_blank">大会板块</a>
                    </li>
                    <li>
                        <a href="hzhp.html" target="_blank">合作伙伴</a>
                    </li>
                    <li>
                        <a href="media.html" target="_blank">媒体合作</a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" class="toshow" target="_blank">往届回顾</a>
                        <ul class="drop-nav">
                            <li>
                                <a href="http://www.youxituoluo.com/jintuoluo2016" target="_blank">首届金陀螺奖</a>
                            </li>
                            <li>
                                <a href="http://www.youxituoluo.com/jintuoluo2017" target="_blank">第二届金陀螺奖</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <!--轮播-->
    <div id="carousel-example-generic" class="carousel slide my-slide" data-ride="carousel" data-interval="3000">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
        </ol>
        <!-- Wrapper for slides -->
        <div class="carousel-inner" role="listbox">
            <div class="item active">
                <img src="img/gold_top.png" alt="金陀螺">
            </div>
            <div class="item">
                <img src="img/vote_caijing_banner.jpg" alt="游戏财经">
            </div>
        </div>
    </div>
    <div class="goldtl-main-img">
        <img src="img/goldtl_main_bg.png" width="100%" height="100%" />
        <button class="singbtn" type="button" data-toggle="modal" data-target="#myModal">
				<img src="img/gold-signbtn.png" width="100%" height="100%" />
			</button>
    </div>
    <div class="vote_bottom">
        <img src="img/vote_bottom.png" width="100%" height="100%">
    </div>

    <!--报名弹框-->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" data-backdrop="false" aria-labelledby="myModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="close" data-dismiss="modal" aria-label="Close">X</div>
                    <form class="tuoluo-form" name="signForm" id="signForm" action="#">
                        <div class="form-group">
                            <label class="common-color" for="company_name">参评企业名称  &nbsp;<img src="img/icon_must.png"/></label>
                            <input type="text" class="form-control" name="company_name" id="company_name" required="required" autocomplete="off" placeholder="请填写参赛项目/游戏/企业/战队/主播/媒体名">
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="company_short">参评项目简称 &nbsp;<img src="img/icon_must.png"/></label>
                            <input type="text" class="form-control" name="company_short" id="company_short" required="required" autocomplete="off" placeholder="请填写参赛项目/游戏/企业/战队/主播/媒体名的简称">
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="username">姓名 &nbsp;<img src="img/icon_must.png"/></label>
                            <input type="text" class="form-control" name="username" id="username" required="required" autocomplete="off" placeholder="请填写报名人姓名">
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="position">职位 &nbsp;<img src="img/icon_must.png"/></label>
                            <input type="text" class="form-control" name="position" id="position" required="required" autocomplete="off" placeholder="请填写报名人职位">
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="telphone">联系电话 &nbsp;<img src="img/icon_must.png"/></label>
                            <input type="text" class="form-control" name="telphone" id="telphone" required="required" autocomplete="off" placeholder="请填写报名人手机号码">
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="email">邮箱 &nbsp;<img src="img/icon_must.png"/></label>
                            <input type="email" class="form-control" name="email" id="email" required="required" autocomplete="off" placeholder="请填写报名人邮箱地址">
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="modules">参评类别 &nbsp;<img src="img/icon_must.png"/></label>
                            <select class="form-control" id="modules" name="modules" onChange="change()" required="required">
									<option> --请选择-- </option>
									<option value="0"> 游戏类 </option>
									<option value="1"> 电竞类 </option>
									<option value="2"> 区块链类 </option>
									<option value="3"> VR/AR类 </option>
								</select>
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="award">参评奖项 &nbsp;<img src="img/icon_must.png"/></label>
                            <select class="form-control" name="award" id="award" required="required">
									<option> --请选择-- </option>
								</select>

                        </div>
                        <div class="form-group">
                            <label class="common-color" for="introduce">参评企业介绍 &nbsp;<img src="img/icon_must.png"/></label>
                            <textarea class="form-control" autocomplete="off" name="introduce" id="introduce" placeholder="请输入参评企业介绍文字内容" required="required"> </textarea>
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="show_pic">参评主图 &nbsp;<img src="img/icon_must.png"/></label>
                            <input type="file" class="form-control" name="showPic" id="show_pic" required="required" accept="image/jpg,image/jpeg,image/png,image/PNG">
                        </div>
                        <div class="form-group">
                            <label class="common-color">以上带&nbsp;<img src="img/icon_must.png"/>&nbsp;为必填项</label>
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="data_pic1">图片资料1</label>
                            <input type="file" class="form-control" name="dataPic1" id="data_pic1">
                        </div>
                        <div class="form-group">
                            <label class="common-color" for="data_pic2">图片资料2</label>
                            <input type="file" class="form-control" name="dataPic2" id="data_pic2">
                        </div>
                        <input type="hidden" name="show_pic" />
                        <input type="hidden" name="data_pic1" />
                        <input type="hidden" name="data_pic2" />
                        <div class="form-group form-btn">
                            <button class="btn sign-btn">提交</button>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js" type="text/javascript"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/js-sha256/0.9.0/sha256.min.js"></script>
    <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>
    <script src="js/vote.js" type="text/javascript" charset="utf-8"></script>

    <script type="text/javascript">
        var rootPath = "https://www.tuoluohuodong.com";
        var awardsArray = [
            [{
                id: "0",
                name: "年度最具影响力游戏奖"
            }, {
                id: "1",
                name: "年度最佳移动游戏网游奖"
            }, {
                id: "2",
                name: "年度最佳移动游戏单机奖"
            }, {
                id: "3",
                name: "年度最具期待新游奖"
            }, {
                id: "4",
                name: "年度最佳H5游戏奖"
            }, {
                id: "5",
                name: "年度最佳IP类游戏奖"
            }, {
                id: "6",
                name: "年度最佳小游戏奖"
            }, {
                id: "7",
                name: "年度最佳出海游戏奖"
            }, {
                id: "8",
                name: "年度最佳独立游戏奖"
            }, {
                id: "9",
                name: "年度新锐游戏企业奖"
            }, {
                id: "10",
                name: "年度最佳出海游戏企业奖"
            }, {
                id: "11",
                name: "年度最佳独立游戏发行商奖"
            }, {
                id: "12",
                name: "年度最佳移动游戏发行商奖"
            }, {
                id: "13",
                name: "年度最佳营销服务商"
            }, {
                id: "14",
                name: "年度最佳服务商奖"
            }, {
                id: "15",
                name: "年度最具影响力游戏企业奖"
            }, {
                id: "16",
                name: "年度最具影响力人物奖"
            }, {
                id: "17",
                name: "年度最佳游戏制作人奖"
            }, {
                id: "18",
                name: "年度最佳游戏公会奖"
            }, ],
            [
                //{ id: "0", name: "年度最佳电子竞技游戏奖" },
                {
                    id: "1",
                    name: "年度最佳游戏直播平台奖"
                }, {
                    id: "2",
                    name: "年度最具期待赛事平台奖"
                }, {
                    id: "3",
                    name: "年度最佳移动电竞俱乐部"
                },
            ],
            [{
                    id: "0",
                    name: "年度区块链风云人物"
                }, {
                    id: "1",
                    name: "年度最佳区块链投资机构"
                }, {
                    id: "2",
                    name: "年度区块链优质项目"
                },
                //{ id: "3", name: "年度区块链数字钱包TOP10" },
                {
                    id: "4",
                    name: "年度最佳区块链游戏"
                }, {
                    id: "5",
                    name: "年度最佳区块链公链"
                }, {
                    id: "6",
                    name: "年度最佳区块链Dapp"
                }, {
                    id: "7",
                    name: "年度金牌矿机品牌"
                }, {
                    id: "8",
                    name: "年度最具影响力社区"
                },
            ],
            [{
                id: "0",
                name: "最具潜力VR游戏奖"
            }, {
                id: "1",
                name: "年度最佳VR游戏奖"
            }, {
                id: "2",
                name: "年度最佳VR教育企业奖"
            }, {
                id: "3",
                name: "年度最佳VR行业应用奖"
            }, {
                id: "4",
                name: "年度最佳VR影视作品奖"
            }, {
                id: "5",
                name: "年度最佳VR硬件奖"
            }, {
                id: "6",
                name: "年度最佳AR硬件奖"
            }, {
                id: "7",
                name: "最佳VR/AR技术创新奖"
            }, {
                id: "8",
                name: "最具商业潜力VR/AR企业奖"
            }, {
                id: "9",
                name: "年度最具影响力VR/AR企业奖"
            }, ]
        ]

        function change() {
            var sltModules = document.signForm.modules;
            var sltAward = document.signForm.award;
            var arr = awardsArray[sltModules.selectedIndex - 1];
            sltAward.length = 1;
            for (var i = 0; i < arr.length; i++) {
                //sltAward[i+1]=new Option(arr[i],i);
                addoption(arr[i].id, arr[i].name)
            }

            function addoption(value, text) {
                var opt = document.createElement("option")
                opt.value = value
                opt.text = text
                sltAward.options.add(opt)
            }
        }
        //主图上传
        $("#show_pic").change(function() {
                //var show_pic = $("input[name='show_pic']").val();
                var formData = new FormData();
                formData.append('file1', $("#show_pic")[0].files[0]); /*获取上传的图片对象*/
                $.ajax({
                    url: rootPath + '/index.php?m=vote&c=vote_info&a=upload_pic',
                    type: 'POST',
                    data: formData,
                    contentType: false,
                    processData: false,
                    header: {
                        "Content-Type": "multipart/form-data"
                    },
                    success: function(res) {
                        var res = JSON.parse(res);
                        if (res.code == 200) {
                            alert("上传成功")
                        }
                        $("input[name='show_pic']").val(res.data.path)
                    }
                })
            })
            //附图1
        $("#data_pic1").change(function() {
                //var data_pic1 = $("input[name='data_pic1']").val();
                var formData = new FormData();;
                formData.append('file2', $("#data_pic1")[0].files[0]); /*获取上传的图片对象*/
                $.ajax({
                    url: rootPath + '/index.php?m=vote&c=vote_info&a=upload_pic',
                    type: 'POST',
                    data: formData,
                    contentType: false,
                    processData: false,
                    header: {
                        "Content-Type": "multipart/form-data"
                    },
                    success: function(res) {
                        var res = JSON.parse(res);
                        if (res.code == 200) {
                            alert("上传成功")
                        }
                        $("input[name='data_pic1']").val(res.data.path)
                    }
                })
            })
            //附图2
        $("#data_pic2").change(function() {
            // var data_pic2 = $("input[name='data_pic2']").val();
            var formData = new FormData();
            formData.append('file3', $("#data_pic2")[0].files[0]); /*获取上传的图片对象*/
            $.ajax({
                url: rootPath + '/index.php?m=vote&c=vote_info&a=upload_pic',
                type: 'POST',
                data: formData,
                contentType: false,
                processData: false,
                header: {
                    "Content-Type": "multipart/form-data"
                },
                success: function(res) {
                    var res = JSON.parse(res);
                    if (res.code == 200) {
                        alert("上传成功")
                    }
                    $("input[name='data_pic2']").val(res.data.path);
                }
            })
        })

        isSubmit = false;
        //提交
        $(".sign-btn").click(function(e) {
            e.preventDefault();
            $(".sign-btn").attr("disabled", "true");
            if (isSubmit) {
                return;
            }

            var signForm = $("#signForm").serialize();
            var data = {};
            var sortArr = [];
            var d = {};
            var f = $("#signForm").serializeArray();
            $.each(f, function() {
                sortArr.push(this.name);
                d[this.name] = $.trim(this.value);
            })

            sortArr = sortArr.sort();

            $.each(sortArr, function(index, item) {
                data[item] = d[item];
            })

            var $time = (new Date()).getTime();
            var $randomString = _getRandomString(10);

            data['randtime'] = $time;
            data['randstring'] = $randomString;
            d['randtime'] = $time;
            d['randstring'] = $randomString;


            var $a = [];
            $.each(data, function(index, item) {
                $a.push(index + '=' + item);
            })

            var str = '';
            str = $a.join("&");
            str = md5(sha256(str));

            d['helloworld'] = str;

            $.ajax({
                type: "post",
                url: rootPath + "/index.php?m=vote&c=vote_info&a=update_join_info",
                header: {
                    'content-type': 'application/x-www-form-urlencoded'
                },
                data: d,
                success: function(res) {
                    var res = JSON.parse(res)
                    if (res.code == 0) {
                        alert(res.message);
                        $(".sign-btn").removeAttr("disabled");
                        isSubmit = false;
                        return;
                    }
                    if (res.code == 200) {
                        alert("报名成功！")
                    }
                    window.location.reload();
                }
            });

        });

        function _getRandomString(len) {
            len = len || 32;
            var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
            var maxPos = $chars.length;
            var pwd = '';
            for (i = 0; i < len; i++) {
                pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
            }
            return pwd;
        }
    </script>
</body>

</html>